package com.zs.blog.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zs.blog.model.dto.ArticleCategoryDTO;
import com.zs.blog.model.dto.CategoryDTO;
import com.zs.blog.model.entity.Category;
import com.zs.blog.model.vo.CategoryListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Title: ICategoryMapper
 * @Author zs
 * @Package com.zs.blog.dao
 * @Date 2024/10/20 16:09
 * @description: 分类映射接口
 */
public interface ICategoryMapper extends BaseMapper<Category> {

    List<CategoryDTO> listCategoryWithPagination(IPage<CategoryDTO> page);

    List<CategoryDTO> listCategoryBySearchCondition(IPage<CategoryDTO> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<Category> lqw);

    Integer getArticleCountUnderCategory(@Param("ids") List<Integer> categoryIdList);

    void deleteCategoryByIds(@Param("ids") List<Integer> categoryIdList);

    List<CategoryListVO> listCategory();

    ArticleCategoryDTO getCategoryByArticleId(Long articleId);
}
